package com.ccg.service;

import com.ccg.dao.RoomTypeDao;
import com.ccg.entity.RoomType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class RoomTypeService {

    @Autowired
    RoomTypeDao roomtypeDao;

    //添加房间类型
    public int addRoomType(RoomType roomtype){
        return roomtypeDao.addRoomType(roomtype);
    }
    //动态修改房间类型的相关数据
    public int updateRoomType(RoomType roomtype){
        return roomtypeDao.updateRoomType(roomtype);
    }

    //根据房间类型编号修改房间类型的价格
    public int updatePriceByRt_id(RoomType roomtype) {
        return roomtypeDao.updatePriceByRt_id(roomtype);
    }

    //根据房间编号修改房间的描述
    public int updateStatusByRt_id(RoomType roomtype) {
        return roomtypeDao.updateStatusByRt_id(roomtype);
    }

    //根据房间类型修改类型名称
    public int updateTypeNameByRt_id(RoomType roomtype) {
        return roomtypeDao.updateTypeNameByRt_id(roomtype);
    }

    //<!--根据房间类型修改房间数量-->
    public int updateNumberByRt_id(RoomType roomtype){
        return roomtypeDao.updateNumberByRt_id(roomtype);
    }
    public RoomType getRoomTypeByRt_Id(int rt_id){
        return roomtypeDao.getRoomTypeByRt_Id(rt_id);
    }
    //查找所有房间类型信息
    public List<RoomType> findAllTypeName() {
        return roomtypeDao.findAllTypeName();
    }
    //根据房间类型查找房间类型以及库存
    public RoomType roomTypeDateNumber(int rt_id){
        return roomtypeDao.roomTypeDateNumber(rt_id);
    }
}